return {
  -- 终端
  "akinsho/toggleterm.nvim",
  enabled = true,
  version = "*",
  config = function()
    require("toggleterm").setup {
      size = function(term)
        if term.direction == "horizontal" then
          return 15
        elseif term.direction == "vertical" then
          return vim.o.columns * 0.4
        end
      end,
      open_mapping = [[<S-C-\>]],
      -- 打开新终端后自动进入插入模式
      start_in_insert = true,
      direction = "horizontal", -- "vertical" | "horizontal" | "tab" | "float",
    }

    vim.api.nvim_set_keymap("t", "<Esc>", "<C-\\><C-n>", { noremap = true, silent = true })
    vim.api.nvim_set_keymap("t", "<leader>l", "<Cmd> wincmd l<CR>", { noremap = true, silent = true })
    vim.api.nvim_set_keymap("t", "<leader>h", "<Cmd> wincmd h<CR>", { noremap = true, silent = true })
    vim.api.nvim_set_keymap("t", "<leader>j", "<Cmd> wincmd j<CR>", { noremap = true, silent = true })
    vim.api.nvim_set_keymap("t", "<leader>k", "<Cmd> wincmd k<CR>", { noremap = true, silent = true })
  end,
}
